home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2001 / MacHack 2001.toast / pc / The Hacks / Airport Radar™ / Source / BaseStation.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-06-23  |  1.7 KB  |  88 lines

  1. /*
  2.     File:         BaseStation.h
  3.  
  4.     Contains:    Class to handle a base station
  5.  
  6.     Version:    MacHack 2001
  7. */
  8.  
  9. #ifndef __BASESTATION__
  10. #define __BASESTATION__
  11.  
  12. // ---------------------------------------------------------------------------
  13. //    includes
  14. // ---------------------------------------------------------------------------
  15.  
  16. #include "WirelessAPI.h"
  17.  
  18. class SectPoint
  19. {
  20.     public:
  21.         double        fX;
  22.         double        fY;
  23. };
  24.  
  25. class SectPoints
  26. {
  27.     public:
  28.         class BaseStation *        fBaseStation1;
  29.         class BaseStation *        fBaseStation2;
  30.         SectPoint                fPoint1;
  31.         SectPoint                fPoint2;
  32. };
  33.         
  34.  
  35. // ---------------------------------------------------------------------------
  36. //    classes
  37. // ---------------------------------------------------------------------------
  38.  
  39. class BaseStation
  40. {
  41. public:
  42.                         BaseStation();
  43.     virtual                ~BaseStation();
  44.  
  45.     void                UpdateInfo(WirelessNodeInfoPtr inBaseInfo);
  46.  
  47.     double                fSignal;
  48.     double                fSignalAverage;
  49.     double                fNoise;
  50.     UInt16                fMACAddress[3];
  51.     double                fX;
  52.     double                fY;
  53.     const char*            fName;
  54.     
  55.     Boolean                fStrongSignal;
  56.     double                fR;
  57. };
  58.  
  59. class BaseStationList
  60. {
  61. public:
  62.                         BaseStationList();
  63.     virtual                ~BaseStationList();
  64.  
  65.     void                AddBase(WirelessNodeInfoPtr inBaseInfo);
  66.  
  67.     void                IdleBases();
  68.     
  69.     void                MapMyLocation();
  70.     
  71.     void                FindIntersectionPoints(BaseStation * inBase1, BaseStation * inBase2, SectPoints & inSectPoint);
  72.  
  73.     void                FindMostLikelyLocation(const SectPoints * inSectPoint, UInt32 inSectPointCount);
  74.  
  75.     double                CalcDistanceSquared(const SectPoint & inPoint1, const SectPoint & inPoint2);
  76.  
  77.     BaseStation            fBases[32];
  78.     UInt32                fBaseCount;
  79.     SectPoints             fSectPoints[3];
  80.  
  81.     WirelessDeviceRef    fRef;
  82.     
  83.     double                fX;
  84.     double                fY;
  85. };
  86.  
  87. #endif    // __BASESTATION__
  88.